﻿<%@ Page Title="" Language="C#" MasterPageFile="~/user/User.master" AutoEventWireup="true"
    CodeFile="default.aspx.cs" Inherits="user_index" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cc1" %>
<%@ Register Src="BestSeller.ascx" TagName="BestSeller" TagPrefix="uc1" %>
<%@ Register Src="hotproduct.ascx" TagName="hotproduct" TagPrefix="uc2" %>
<%@ Register Src="RatingHigh.ascx" TagName="RatingHigh" TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Thanhnx Developer</title>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceSearch" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" CssClass="CustomTabStyle">
        <asp:TabPanel runat="server" ID="TabPanel1" HeaderText="| BEST SELLER |">
            <HeaderTemplate>
                | BEST SELLER |
            </HeaderTemplate>
            <ContentTemplate>
                <uc1:BestSeller ID="BestSeller2" runat="server" />
            </ContentTemplate>
        </asp:TabPanel>
        <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="HOT PRODUCT">
            <ContentTemplate>
                <uc2:hotproduct ID="hotproduct1" runat="server" />
            </ContentTemplate>
        </asp:TabPanel>
        <asp:TabPanel ID="TabPanel3" runat="server" HeaderText="| RATING HIGH |">
            <ContentTemplate>
                <uc3:RatingHigh ID="RatingHigh1" runat="server" />
            </ContentTemplate>
        </asp:TabPanel>
    </asp:TabContainer>
    <br />
    <br />
    <div class="tcat">
        ALL PRODUCT
    </div>
    <br />
    <table style="width: 100%; margin-left: 10px">
        <tr>
            <td>
                <asp:Label ID="Label6" runat="server" Text="Search" Font-Bold="False"></asp:Label>
                <asp:DropDownList ID="DropDownListSoryBy" runat="server" Width="120" OnSelectedIndexChanged="DropDownListSoryBy_SelectedIndexChanged"
                    AutoPostBack="True" Height="19px">
                    <asp:ListItem>All Product</asp:ListItem>
                    <asp:ListItem>Price: Low to High</asp:ListItem>
                    <asp:ListItem>Price: High to Low</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
                <div style="float: left">
                    <asp:DropDownList ID="drcategory" runat="server" Width="170px" 
                     Height="19px" AppendDataBoundItems="True" AutoPostBack="True" 
                        DataSourceID="SqlDataSource1" DataTextField="cat_name" 
                        DataValueField="cat_name" 
                        onselectedindexchanged="drcategory_SelectedIndexChanged">
                        <asp:ListItem Selected="True">Select category</asp:ListItem>
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="SELECT [cat_name], [cat_id] FROM [tbl_category]">
                    </asp:SqlDataSource>
                    &nbsp;
                    <asp:TextBox ID="TextBox1" runat="server" Width="150px"></asp:TextBox>&nbsp;
                    <asp:DropDownList ID="drtpricefrom" runat="server" Width="90px" 
                        Height="19px">
                        <asp:ListItem>Price from</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>20</asp:ListItem>
                        <asp:ListItem>30</asp:ListItem>
                        <asp:ListItem>50</asp:ListItem>
                        <asp:ListItem>80</asp:ListItem>
                        <asp:ListItem>100</asp:ListItem>
                    </asp:DropDownList>&nbsp;
                    <asp:DropDownList ID="drpriceto" runat="server" Width="90px" Height="19px">
                        <asp:ListItem>Price to</asp:ListItem>
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>20</asp:ListItem>
                        <asp:ListItem>30</asp:ListItem>
                        <asp:ListItem>50</asp:ListItem>
                        <asp:ListItem>80</asp:ListItem>
                        <asp:ListItem>100</asp:ListItem>
                        <asp:ListItem>150</asp:ListItem>
                        <asp:ListItem>200</asp:ListItem>
                    </asp:DropDownList>&nbsp;
                   
                    <asp:ImageButton ID="imgSearch" runat="server" ImageUrl="~/images/search_icon.gif"
                        ImageAlign="AbsBottom" OnClick="imgSearch_Click" />
                </div>
                <asp:UpdateProgress ID="UpdateprogressSearch" runat="server">
                    <ProgressTemplate>
                        <div style="float: right; margin-right: 10px;">
                            <img src="../images/icon_loading.gif" alt="Loading" />
                        </div>
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </td>
        </tr>
    </table>
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="imgSearch" />
            <asp:AsyncPostBackTrigger ControlID="DropDownListSoryBy" />
            <asp:AsyncPostBackTrigger ControlID="drcategory"/>
        </Triggers>
        <ContentTemplate>
            <asp:DataList ID="dtListProduct" runat="server" RepeatColumns="2" Width="750px" RepeatDirection="Horizontal">
                <ItemTemplate>
                    <div id="viewproduct">
                        <a href="productDetails.aspx?Cat=<%#Eval("cat_id")%>&ID=<%#Eval("pd_id") %>&Price=<%#Eval("pd_price") %>">
                            <%#Eval("pd_name") %></a>
                        <br />
                        <asp:Image ID="imageProduct" runat="server" ImageUrl='<%#Eval("pd_image")%>' Width="150"
                            Height="150" />
                        <br />
                        <asp:Label ID="Label2" runat="server" Text='<%#Eval("pd_description") %>' Font-Size="12px"
                            ForeColor="#A6A4A4"></asp:Label>
                        <br />
                        <br />
                        <asp:Label ID="Label5" runat="server" Text="Price:" ForeColor="#CC0000"></asp:Label><asp:Label
                            ID="Label3" runat="server" Text='<%#String.Format("{0:0,0}",Eval("pd_price")) %>'></asp:Label><asp:Label
                                ID="Label4" runat="server" Text="$"></asp:Label>
                        
                        <%--<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/icon-add.jpg"
                            OnCommand="ImageButton1_Command" CommandArgument='<%#Eval("pd_id")%>' CommandName="AddToCart" />--%>
                    </div>
                </ItemTemplate>
            </asp:DataList>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <div>
        <cc1:CollectionPager ID="ClPageProduct" runat="server" MaxPages="5" PageSize="8"
            ResultsFormat="Display: {0}-{1} (of {2})" 
            ResultsStyle="margin-left: 20px;" ControlCssClass="CollectionPager"
            LabelText="Page:" PageNumbersDisplay="Numbers" ResultsLocation="None" ShowFirstLast="True"
            SliderSize="5" FirstText="First" LabelStyle="margin-left: 20px;" BackNextDisplay="Buttons"
            BackNextButtonStyle="" BackNextStyle="margin: 10px;" ControlStyle="border: 1px solid #666;margin: 5px;"
            PagingMode="QueryString">
        </cc1:CollectionPager>
    </div>
</asp:Content>
